Optimal. Leaf size=72 \[ -\frac {\cot (c+d x)}{a^2 d}-\frac {2 b \log (\tan (c+d x))}{a^3 d}+\frac {2 b \log (a+b \tan (c+d x))}{a^3 d}-\frac {b}{a^2 d (a+b \tan (c+d x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 72, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {3597, 46}
\begin {gather*} -\frac {2 b \log (\tan (c+d x))}{a^3 d}+\frac {2 b \log (a+b \tan (c+d x))}{a^3 d}-\frac {b}{a^2 d (a+b \tan (c+d x))}-\frac {\cot (c+d x)}{a^2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 46
Rule 3597
Rubi steps
\begin {align*} \int \frac {\csc ^2(c+d x)}{(a+b \tan (c+d x))^2} \, dx &=\frac {b \text {Subst}\left (\int \frac {1}{x^2 (a+x)^2} \, dx,x,b \tan (c+d x)\right )}{d}\\ &=\frac {b \text {Subst}\left (\int \left (\frac {1}{a^2 x^2}-\frac {2}{a^3 x}+\frac {1}{a^2 (a+x)^2}+\frac {2}{a^3 (a+x)}\right ) \, dx,x,b \tan (c+d x)\right )}{d}\\ &=-\frac {\cot (c+d x)}{a^2 d}-\frac {2 b \log (\tan (c+d x))}{a^3 d}+\frac {2 b \log (a+b \tan (c+d x))}{a^3 d}-\frac {b}{a^2 d (a+b \tan (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.43, size = 109, normalized size = 1.51 \begin {gather*} \frac {-a^2 \cot ^2(c+d x)-a b \cot (c+d x) (1+2 \log (\sin (c+d x))-2 \log (a \cos (c+d x)+b \sin (c+d x)))+b^2 (1-2 \log (\sin (c+d x))+2 \log (a \cos (c+d x)+b \sin (c+d x)))}{a^3 d (b+a \cot (c+d x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.32, size = 67, normalized size = 0.93
method | result | size |
derivativedivides | \(\frac {-\frac {b}{a^{2} \left (a +b \tan \left (d x +c \right )\right )}+\frac {2 b \ln \left (a +b \tan \left (d x +c \right )\right )}{a^{3}}-\frac {1}{a^{2} \tan \left (d x +c \right )}-\frac {2 b \ln \left (\tan \left (d x +c \right )\right )}{a^{3}}}{d}\) | \(67\) |
default | \(\frac {-\frac {b}{a^{2} \left (a +b \tan \left (d x +c \right )\right )}+\frac {2 b \ln \left (a +b \tan \left (d x +c \right )\right )}{a^{3}}-\frac {1}{a^{2} \tan \left (d x +c \right )}-\frac {2 b \ln \left (\tan \left (d x +c \right )\right )}{a^{3}}}{d}\) | \(67\) |
risch | \(-\frac {2 i \left (2 i a b \,{\mathrm e}^{2 i \left (d x +c \right )}-a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+2 b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-a^{2}-2 b^{2}\right )}{\left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) \left (i a +b \right ) \left (b \,{\mathrm e}^{2 i \left (d x +c \right )}+i a \,{\mathrm e}^{2 i \left (d x +c \right )}-b +i a \right ) a^{2} d}-\frac {2 b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{a^{3} d}+\frac {2 b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {i b +a}{i b -a}\right )}{a^{3} d}\) | \(178\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.32, size = 74, normalized size = 1.03 \begin {gather*} -\frac {\frac {2 \, b \tan \left (d x + c\right ) + a}{a^{2} b \tan \left (d x + c\right )^{2} + a^{3} \tan \left (d x + c\right )} - \frac {2 \, b \log \left (b \tan \left (d x + c\right ) + a\right )}{a^{3}} + \frac {2 \, b \log \left (\tan \left (d x + c\right )\right )}{a^{3}}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 293 vs.
\(2 (72) = 144\).
time = 0.38, size = 293, normalized size = 4.07 \begin {gather*} -\frac {a^{2} b^{2} - {\left (a^{4} + 2 \, a^{2} b^{2}\right )} \cos \left (d x + c\right )^{2} - {\left (a^{3} b + 2 \, a b^{3}\right )} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} b^{2} + b^{4} - {\left (a^{2} b^{2} + b^{4}\right )} \cos \left (d x + c\right )^{2} + {\left (a^{3} b + a b^{3}\right )} \cos \left (d x + c\right ) \sin \left (d x + c\right )\right )} \log \left (2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}\right ) - {\left (a^{2} b^{2} + b^{4} - {\left (a^{2} b^{2} + b^{4}\right )} \cos \left (d x + c\right )^{2} + {\left (a^{3} b + a b^{3}\right )} \cos \left (d x + c\right ) \sin \left (d x + c\right )\right )} \log \left (-\frac {1}{4} \, \cos \left (d x + c\right )^{2} + \frac {1}{4}\right )}{{\left (a^{5} b + a^{3} b^{3}\right )} d \cos \left (d x + c\right )^{2} - {\left (a^{6} + a^{4} b^{2}\right )} d \cos \left (d x + c\right ) \sin \left (d x + c\right ) - {\left (a^{5} b + a^{3} b^{3}\right )} d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\csc ^{2}{\left (c + d x \right )}}{\left (a + b \tan {\left (c + d x \right )}\right )^{2}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.52, size = 74, normalized size = 1.03 \begin {gather*} \frac {\frac {2 \, b \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{a^{3}} - \frac {2 \, b \log \left ({\left | \tan \left (d x + c\right ) \right |}\right )}{a^{3}} - \frac {2 \, b \tan \left (d x + c\right ) + a}{{\left (b \tan \left (d x + c\right )^{2} + a \tan \left (d x + c\right )\right )} a^{2}}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.84, size = 79, normalized size = 1.10 \begin {gather*} \frac {2\,b\,\ln \left (\frac {a+b\,\mathrm {tan}\left (c+d\,x\right )}{\mathrm {tan}\left (c+d\,x\right )}\right )}{a^3\,d}-\frac {2\,b}{a^2\,d\,\left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )}-\frac {1}{a\,d\,\mathrm {tan}\left (c+d\,x\right )\,\left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________